<template>
	<view class="addres-box" :style="{direction:i18nLocale=='ug'?'rtl':''}" @click="changeaddress">
		<u-icon name="map-fill" size="26" color="#45bc1b"></u-icon>
		<text>{{i18nLocale=='ug'?storeValue.ug_name:storeValue.cn_name}}</text>
		<text v-if="!storeValue">{{$t('SelecetAddress')}}</text>
	</view>
</template>

<script>
	import {
		Translation
	} from '@/utils/getAddres.js';
	export default {
		name: "Address",
		data() {
			return {

			};
		},
		computed: {
			storeValue() {
				return this.$store.state.address;
			},
			i18nLocale() {
				return this.$i18n.locale;
			}
		},
		methods: {
			changeaddress() {
				uni.navigateTo({
					url: '/pages/me/address/selecetaddress'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.addres-box {
		width: 100%;
		display: flex;
		align-items: center;
		box-sizing: border-box;
		background-color: $uni-bg-color-box;
		border-radius: $uni-border-radius-base;
		box-shadow: $uni-bg-shadow;
		margin-top: $uni-spacing-margin-sm;
		padding: $uni-spacing-padding-sm;

		text {
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
			color: $uni-color-title;
			padding: 10rpx 0rpx;
			padding-left: 10rpx;
			font-size: $uni-font-size-sm1;
			
		}
	}
</style>